package com.loveprogrammer.eternity.factory;

import com.loveprogrammer.eternity.action.BaseAction;
import com.loveprogrammer.eternity.enums.QualityEnum;
import com.loveprogrammer.eternity.factory.template.MonsterTemplate;
import com.loveprogrammer.eternity.model.product.Equipment;
import com.loveprogrammer.eternity.model.product.Things;
import com.loveprogrammer.eternity.model.product.eggs.Egg;
import com.loveprogrammer.eternity.model.product.equipment.Weapon;

import java.util.Random;

/**
 * @version 1.0.0
 * @description:
 * @author: eric
 * @date: 2023-01-18 16:51
 **/
public class EggFactory extends BaseAction {

    public static Egg getEgg(int id, QualityEnum qualityEnum) {
        MonsterTemplate monsterTemplate = MonsterFactory.getById(id);
        Egg egg = new Egg(monsterTemplate.getName() + "的卵", "egg", ""
                , QualityEnum.getById(new Random().nextInt(6)), monsterTemplate);
        if(qualityEnum != null){
            egg.setQuality(qualityEnum);
        }
        return egg;
    }
}
